Generating contextual search presentations

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for generating contextual search presentations. One of the methods includes obtaining selection data identifying a term selected by a user from a document displayed to the user; determining whether or not the context data and the selection data satisfy one or more criteria for presenting any of one or more types of special case contextual search presentations; in response to determining that the context data and the selection satisfy criteria for presenting a first type of special case contextual search presentation, generating a first special case contextual search presentation of the first type; in response to determining that the context data and the selection data do not satisfy the criteria, generating a default contextual search presentation; and providing the first special case contextual search presentation or the default contextual search presentation for presentation to the user.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. application Ser. No.14/308,565, filed Jun. 18, 2014, the contents of which are incorporatedby reference herein.

BACKGROUND

This specification relates to Internet search engines.

Internet search engines aim to identify resources, e.g., web pages,images, text documents, and multimedia content, that are relevant to auser's information needs and to present information about the resourcesin a manner that is most useful to the user. Internet search enginesgenerally return a set of search results, each identifying a respectiveresource, in response to a user-submitted query.

SUMMARY

This specification describes technologies that relate to generatingcontextual search presentations.

In general, one innovative aspect of the subject matter described inthis specification can be embodied in methods that include the actionsof obtaining selection data identifying a term selected by a user from adocument displayed to the user, the term comprising one or more adjacentwords, and context data comprising one or more other words in thedocument; determining whether or not the context data and the selectiondata satisfy one or more criteria for presenting any of one or moretypes of special case contextual search presentations, wherein each typeof special case contextual search presentation includes a formattedpresentation of a different type of content; in response to determiningthat the context data and the selection satisfy criteria for presentinga first type of special case contextual search presentation, generatinga first special case contextual search presentation of the first typefor the selected term; in response to determining that the context dataand the selection data do not satisfy the criteria for presenting any ofthe types of special case contextual search presentations, generating adefault contextual search presentation for the selected term; andproviding the first special case contextual search presentation or thedefault contextual search presentation for presentation to the user.Other embodiments of this aspect include corresponding computer systems,apparatus, and computer programs recorded on one or more computerstorage devices, each configured to perform the actions of the methods.For a system of one or more computers to be configured to performparticular operations or actions means that the system has installed onit software, firmware, hardware, or a combination of them that inoperation cause the system to perform the operations or actions. For oneor more computer programs to be configured to perform particularoperations or actions means that the one or more programs includeinstructions that, when executed by data processing apparatus, cause theapparatus to perform the operations or actions.

The foregoing and other embodiments can each optionally include one ormore of the following features, alone or in combination. The defaultcontextual search presentation can be a definitional answer box, whereinthe definitional answer box is a formatted presentation of a definitionof the term selected by the user, and wherein generating the contextualsearch presentation comprises obtaining the definitional answer box froma search engine in response to a first search query that includes theselected term. Generating the default contextual search presentation caninclude obtaining search results from the search engine for one or moresearch queries derived from the selected term.

The one or more types of special case contextual search presentationscan include an entity type of contextual search presentation thatincludes a knowledge panel, and wherein a knowledge panel is a formattedpresentation of content relevant to an entity. Determining whether ornot the context data and the selection data satisfy criteria forpresenting the entity type of special case contextual searchpresentation can include: determining, by providing the context data andthe selection data to an entity disambiguation system, whether or notthe selected term refers to an entity in context of the other words inthe document.

The actions can further include: determining that the selected termrefers to an entity in context of the other words in the document; andgenerating an entity contextual search presentation for the selectedterm, comprising obtaining a knowledge panel for the entity referred toby the selected term from a search engine.

The one or more types of special case contextual search presentationscan include a currency type of contextual search presentation thatincludes a currency answer box, wherein a currency answer box is aformatted presentation of an amount in a first currency and acorresponding amount in a second currency. Determining whether or notthe context data and the selection data satisfy criteria for presentingthe currency type of contextual search presentation can include:determining whether or not the context data and selection data identifyany currency and any identified currency is different from a currencyassociated with the user.

The actions can further include: determining that the context data andthe selection data identify an amount in an identified currency and thatthe identified currency is different from the currency associated withthe user; and generating a currency contextual search presentation forthe context data and the selection data, comprising obtaining, from asearch engine, a currency answer box including an amount in theidentified currency and a corresponding amount in the currencyassociated with the user.

The one or more types of special case contextual search presentationscan include a translation type of contextual search presentation thatincludes a translation answer box, and wherein a translation answer boxis a formatted presentation of a translation of a word in a firstlanguage to a word in a second language. Determining whether or not thecontext data and the selection data satisfy criteria for presenting thetranslation type of contextual search presentation can include:identifying a language in which the selected term is written anddetermining whether or not the language in which the selected term iswritten is different from a language associated with the user.

The actions can further include: determining that the language in whichthe selected term is written is different from the language associatedwith the user of the user device; and generating a translationcontextual search presentation for the selected term, comprisingobtaining, from a search engine, a translation answer box including atranslation of the selected term into the language associated with theuser.

The one or more types of special case contextual search presentationscan include a time zone type of contextual search presentation thatincludes a time zone answer box, wherein a time zone answer box is aformatted presentation of a time in a first time zone and acorresponding time in a second time zone. Determining whether or not thecontext data and the selection data satisfy criteria for presenting thetime zone type of contextual search presentation can include:determining whether or not the selected term identifies a time in aparticular time zone and whether the particular time zone is differentfrom a time zone associated with the user.

The actions can further include: determining that the selected termidentifies a time in a particular time zone that is different from thetime zone associated with the user; generating a time zone contextualsearch presentation for the selected term, comprising obtaining, from asearch engine, a time zone answer box the time in the particular timezone and a corresponding time in the time zone associated with the user.

The subject matter described in this specification can be implemented inparticular embodiments so as to realize one or more of the followingadvantages. A user viewing a document on a user device can easily obtainrelevant information about a portion of a document, e.g., a word in thedocument, one or more adjacent words in the document, or another portionof the document. The relevant information is provided to the user in amanner that takes into account the context of the word in the documentor the context that the user is in. Additionally, different kinds ofinformation relevant to the portion of the document can be provided tothe user depending on the context, improving the user experience.Furthermore, the relevant information can be provided to the user in amanner that allows the user to easily view the information whilecontinuing to view the displayed document. The user can identify theportion of the document that he or she desires relevant informationabout through a simple gesture, e.g., a tap touch input or a long-presstouch input on a touchscreen display.

The details of one or more embodiments of the subject matter of thisspecification are set forth in the accompanying drawings and thedescription below. Other features, aspects, and advantages of thesubject matter will become apparent from the description, the drawings,and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A shows an example document displayed on an example mobile device.

FIG. 1B shows an example drag-up bar displayed on the example mobiledevice.

FIG. 1C shows a portion of an example contextual search presentationdisplayed on the example mobile device.

FIG. 1D shows a larger portion of the example contextual searchpresentation displayed on the example mobile device.

FIG. 2 shows an example search system.

FIG. 3 is a flow diagram of an example process for generating acontextual search presentation for a selected word.

FIG. 4 is a flow diagram of an example process for determining whethercriteria for presenting special case contextual search presentations aresatisfied and generating special case contextual search presentations.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

FIG. 1A shows an example document 102 displayed on an example mobiledevice 104. In particular, the document 102 is displayed in a webbrowser executing on the mobile device 104. In the example of FIG. 1A, auser of the mobile device 104 has submitted a touch input 106 on thetouchscreen display of the mobile device 104 to select a word, “Anders,”in the document 102.

FIG. 1B shows an example drag-up bar 110 displayed on the example mobiledevice 104. The drag-up bar 110 is a user interface element thatdisplays the name of an entity “Anders Fogh Rasmussen” that is referredto by the word selected by the user of the mobile device 104. In orderto identify the entity referred to by the input, the mobile device 104has provided word selection data and context data to a search system.The word selection data identifies the word selected by the user, i.e.,“Anders,” and the context data includes other words from the document102. For example, the context data can include each word within athreshold number of words of the selected word in the document. Thecontext data can also include other words or terms associated with thedocument, e.g., the title of the document, headings in the document,captions of images in the document, or anchor text of in-links to thedocument. In response, the search system has provided to the mobiledevice 104 data identifying the entity referred to by the selected wordin the context of the other words in the document, and the mobile device104 has used the data received from the search system to display thename of the entity in the drag-up bar 110.

FIG. 1C shows a portion 120 of an example contextual search presentationdisplayed on the example mobile device 104. In the example of FIG. 1C,the user of the mobile device 104 has submitted a touch input 122selecting and dragging the drag-up bar 110. In response, the mobiledevice 104 has moved the drag-up bar 110 to the corresponding positionto display the portion 120 of the contextual search presentation. Thecontextual search presentation is a presentation that is generated bythe search system for the selected word using the word selection dataand the context data received from the mobile device 104. In some cases,the mobile device 104 has obtained the contextual search presentationfrom the search system before the user submitted the input 122, e.g.,along with the data identifying the entity referred to by the selectedword. In other cases, the mobile device 104 has obtained the contextualsearch presentation from the search system in response to the user inputselecting the drag-up bar.

In the example of FIG. 1C, the contextual search presentation is anentity contextual search presentation that includes a knowledge panel124 for the entity “Anders Fogh Rasmussen.” A knowledge panel is a userinterface element generated by a search engine that includes a formattedpresentation of content about an entity referred to by a received searchquery. The content includes textual representations of values ofattributes associated with the entity and, optionally, other contentrelevant to the entity, e.g., images of the entity. The relevant contentcan vary depending on the type of the entity. For example, a knowledgepanel for a monument or other geographic point of interest can includedifferent information than a knowledge panel for a politician or otherperson of interest. However, as described below, if the word selected bythe user does not refer to an entity, a different kind of contextualsearch presentation can be generated that includes other kinds offormatted content, e.g., various kinds of answer boxes that presentformatted content related to the selected word.

FIG. 1D shows a larger portion 130 of the example contextual searchpresentation displayed on the example mobile device 104. In someimplementations, the mobile device 104 displays the larger portion 130in response to the user of the mobile device continuing to drag thedrag-up bar 110 to a new position. In some other implementations, themobile device continues to increase the size of the portion 130 afterthe user has stopped submitting the touch input 122. For example, afterthe user has stopped submitting the touch input 122, e.g., once the userhas released his or her finger from the touch screen display, the mobiledevice 104 can continue to increase the size of the portion 130 untilthe portion 130 fills a pre-determined proportion, e.g., fifty percent,sixty percent, or seventy percent, of the display. Optionally, when thesize of the portion 130 of contextual search presentation changes, themobile device 104 can re-center the displayed document 102 so that theword selected by the user remains visible.

The larger portion 130 of the contextual search presentation includesthe knowledge panel 124 for the entity “Anders Fogh Rasmussen” andsearch results 134. The search results 134 are search results generatedby a search engine in response to a search query identifying the entityreferred to by the selected word. The user of the mobile device 104 canview additional search results by submitting an additional touch inputto scroll down on the contextual search presentation or can return toviewing the document 102 by submitting a touch input pulling down on thedrag-up bar 110.

FIG. 2 shows an example search system 214. The search system 214 is anexample of an information retrieval system implemented as computerprograms on one or more computers in one or more locations, in which thesystems, components, and techniques described below are implemented.

A user 202 can interact with the search system 214 through a user device204. The user device 204 will generally include a memory, e.g., a randomaccess memory (RAM) 206, for storing instructions and data and aprocessor 208 for executing stored instructions. The memory can includeboth read only and writable memory. For example, the user device 204 canbe a computer, e.g., a smartphone, coupled to the search system 214through a data communication network 212, e.g., local area network (LAN)or wide area network (WAN), e.g., the Internet, or a combination ofnetworks, any of which may include wireless links.

In some implementations, the search system 214 provides a user interfaceto the user device 204 through which the user 202 can interact with thesearch system 214. For example, the search system 214 can provide a userinterface in the form of web pages that are rendered by a web browserrunning on the user device 204, in an app installed on the user device204, e.g., on a mobile device, or otherwise.

A user 202 can use the user device 204 to submit a query 210 to a searchsystem 214. A search engine 230 within the search system 214 performs asearch to identify resources matching the query. When the user 202submits a query 210, the query 210 may be transmitted through thenetwork 212 to the search system 224. The search system 214 includes anindex 222 and the search engine 230. The search system 214 responds tothe search query 210 by generating search results 218, which aretransmitted through the network 212 to the user device 204 forpresentation to the user 202, e.g., as a search results web page to bedisplayed by a web browser running on the user device 204.

When the query 210 is received by the search engine 230, the searchengine 230 identifies resources that satisfy the query 210. The searchengine 230 will generally include an indexing engine 220 that indexesresources, an index 222 that stores the index information, and a rankingengine 252 or other software that generates scores for the resourcesthat satisfy the query 210 and that ranks the resources according totheir respective scores.

Registered users of the search system 214 may provide data to the searchsystem that is stored in a user profile data repository 260. That is,the user 202 may log in to a user account with the search system 214,e.g., through a web browser executing on the user device 204, andprovide data identifying values of particular user attributes, e.g., theuser's birthday, the user's city of residence, places the user hasvacationed, and so on, that are stored in the user profile datarepository 260.

The search system 214 includes or can communicate with a contextualsearch engine 250. The contextual search engine 250 receives wordselection data and context data from user devices and, in response,generates an appropriate contextual search presentation for the selectedword identified by the word selection data. The contextual searchpresentation includes a formatted presentation of content that isrelevant to the selected word. Optionally, the contextual searchpresentation can also include search results obtained from the searchengine 230.

In order to select an appropriate contextual search presentation for agiven selected word, the contextual search engine 250 can communicatewith an entity disambiguation system 270.

The entity disambiguation system 270 receives data identifying a wordfrom a document and context data for the word, i.e., data identifyingother words in the same document as the identified word, and classifiesthe word as either not referring to any entity or referring to aparticular entity. Example entities include people, places, countries,landmarks, animals, historical events, organizations, businesses, sportsteams, sporting events, movies, songs, albums, games, works of art,fictional characters, and so on. For example, the entity disambiguationsystem 270 may be a system that analyzes documents or portions ofdocuments and determines which words in the document refer to entitiesidentified in a database that stores information about entities, e.g., adatabase of structured data that includes nodes that represent entitiesand identifies the type of each entity represented by a node. An exampleof an online database of structured data that exists is the Freebasedatabase that is accessible on the Internet at http://www.freebase.com.

In some cases, the contextual search engine 250 may receive anidentifier for a user account as part of the context data for a selectedword and may use user profile data for the user account that is storedin the user profile data repository 260 in selecting an appropriatecontextual search presentation. Optionally, if the contextual searchengine 250 receives context data that does not include an identifier orif no profile data or limited profile data is stored in the user profiledata repository 260 for the user account identified by a receivedidentifier, the contextual search engine 250 may computationally inferuser attribute values for the user from attribute values of the userdevice from which the search query is received. The contextual searchengine 250 may then use the inferred user attribute values in place ofuser profile data in selecting the appropriate contextual searchpresentation.

Selecting and generating a contextual search presentation using receivedword selection data and context data is described in more detail belowwith reference to FIGS. 3 and 4.

Once the contextual search engine 250 has generated a contextual searchpresentation, the search system 214 transmits the contextual searchpresentation to the user device from which the word selection data andthe context data were received for presentation to the user.

FIG. 3 is a flow diagram of an example process 300 for generating acontextual search presentation for a selected word. For convenience, theprocess 300 will be described as being performed by a system of one ormore computers located in one or more locations. For example, a searchsystem, e.g., the search system 214 of FIG. 2, appropriately programmedin accordance with this specification, can perform the process 300.

The system receives word selection data and context data from a userdevice (step 302). The word selection data identifies a word selected bya user in a document displayed to the user on the user device.Generally, the context data includes one or more other words in thedocument displayed to the user. For example, the context data mayinclude each word that is within a threshold number of words of theselected word in the displayed document. However, the context data mayalso include additional information. For example, the additionalinformation can include user information, e.g., an identifier for a useraccount with the system that the user is currently logged into on theuser device. As another example, the additional information can alsoinclude user device information, e.g., location data that identifies thegeographic location of the user device, language data that identifies apreferred language setting on the user device, sensor data, e.g.,temperature data, and so on.

The system determines, from the word selection data and the contextdata, whether one or more criteria for presenting any of a set of typesof special case contextual search presentations are satisfied (step304). Determining whether the criteria for presenting a special casecontextual presentation are satisfied is described below with referenceto FIG. 4.

If the word selection data and the context data satisfy the criteria forpresenting one of the types of special case contextual searchpresentations, the system generates a special case contextual searchpresentation of the type for the word selected by the user (step 306).Generating a special case contextual search presentation is describedbelow with reference to FIG. 4.

If the word selection data and the context data do not satisfy thecriteria for any of the types of special case presentations, the systemgenerates a default contextual search presentation for the word selectedby the user (step 308).

In some implementations, the default contextual search presentation is adefinitional contextual search presentation. A definitional contextualsearch presentation is a presentation that includes a definitionalanswer box for the word selected by the user.

Generally, an answer box is generated by a search engine, e.g., thesearch engine 230 of FIG. 2, in response to a received search query andincludes a formatted presentation of content that is relevant to thereceived search query. More specifically, a definitional answer box isan answer box generated by the search engine that includes a definitionfor a word in a received search query.

In order to generate the definitional contextual search presentation,the system requests a definitional answer box for the word selected bythe user from the search engine. For example, the system can request thedefinitional answer box by submitting a search query having apre-determined syntax to the search engine, e.g., “[word] definition,”“define: [word],” or “define [word],” where [word] is the word selectedby the user.

The definitional contextual search presentation may also include searchresults obtained from the search engine. The search results may includeone or more of search results obtained in response to the search queryderived from the selected word, search results from other resultsources, or search results for other interpretations of the searchquery. In some implementations, the search results may include searchresults for another search query that is different from the search querysubmitted to the search engine in order to obtain the definitionalanswer box.

The system obtains the definitional answer box and, optionally, thesearch results for the other search query from the search engine andgenerates a definitional answer box that includes the definitionalanswer box and, if search results were obtained, the search results.

The system provides the generated contextual search presentation forpresentation to the user on the user device (step 310). In someimplementations, the system generates and provides the contextual searchpresentation to the user device without receiving any additional userinput after the word selection data and the context data is received. Insome other implementations, the system may only generate and provide thecontextual search presentation after the user has submitted anadditional input, e.g., selecting and dragging a drag-up bar userinterface element on the user device, e.g., the drag-up bar 110 of FIGS.1B-1D.

The above description describes the steps of the process 300 beingperformed by a system remote from the user device that received the userselection of the word. However, in some implementations, some or all ofthe steps of the process 300 are performed by the user device. Forexample, the user device can receive the user input selecting the word,generate the context data for the selected word, and determine whether aspecial case or default contextual search presentation is to bepresented. Once the user device determines the kind of contextual searchpresentation that is to be presented, the system can provide dataidentifying the contextual search presentation, the word selection data,and the context data to the remote system for use in generating anappropriate contextual search presentation. As another example, all ofthe steps of the process 300 can be performed by the user device.

FIG. 4 is a flow diagram of an example process 400 for determiningwhether criteria for presenting special case contextual searchpresentations are satisfied and generating special case contextualsearch presentations. For convenience, the process 400 will be describedas being performed by a system of one or more computers located in oneor more locations. For example, a search system, e.g., the search system214 of FIG. 2, appropriately programmed in accordance with thisspecification, can perform the process 400.

The system receives word selection data and context data (step 402).

The system determines whether the selected word refers to an entityusing the context data (step 404). In order to make this determination,the system provides data identifying the selected word and dataidentifying the other words in the document to an entity disambiguationsystem, e.g., the entity disambiguation system 270 of FIG. 2. Inresponse, the system obtains from the entity disambiguation system dataindicating whether the selected word refers to an entity in the contextof the other words in the document and, if so, the entity referred to bythe selected word.

If the selected word refers to an entity, the system determines that thecriteria for presenting an entity contextual search presentation aresatisfied (step 406) and generates an entity contextual searchpresentation for the entity referred to by the selected word (step 408).An entity contextual search presentation is a presentation that includesa knowledge card for the entity referred to by the word selected by theuser. In order to generate the entity contextual search presentation,the system requests a knowledge card for the word selected by the userfrom the search engine. For example, the system can request theknowledge card by submitting a search query derived from a name of theentity to the search engine, e.g., a search query that includes the nameof the entity and, optionally, one or more terms that disambiguate theentity from other entities having similar names, e.g., “[entity][type],” where [entity] is the name of the entity and [type] is the typeof the entity. For example, if the referred to entity is the basketballplayer “Michael Jordan,” the search query submitted to the search enginemay be “Michael Jordan basketball player.” If the referred to entity isthe actor “Michael Jordan,” however, the search query submitted to thesearch engine may be “Michael Jordan actor.”

As another example, the system can request the knowledge card from thesearch engine by providing to the search engine an identifier for a nodethat represents the entity in an online database of structured data.

The entity contextual search presentation may optionally also includesearch results obtained from the search engine in response to the searchquery derived from the name of the entity referred to by the selectedword.

If the selected word does not refer to an entity, the system determineswhether the criteria for presenting any other special case contextualsearch presentations are satisfied (step 410) and, if the criteria forpresenting any of the other special cases are satisfied, the systemgenerates a special case contextual search presentation for the selectedword (step 412).

For example, the other special case contextual search presentations mayinclude a currency contextual search presentation. A currency contextualsearch presentation is a contextual search presentation that includes acurrency answer box. A currency answer box is an answer box thatpresents an amount in one currency and a corresponding amount in anothercurrency according to a current exchange rate.

In order to determine whether the criteria for presenting the currencycontextual search presentation are satisfied, the system determineswhether the word selected by the user identifies a particular currencyand, if so, whether the particular currency is different from a currencyassociated with the user. The system can determine that the wordselected by the user identifies the currency when the user has selecteda currency name, e.g., “euro,” sign, e.g., “

,” or code, e.g., “EUR.” Optionally, the system can also determine thatthe word selected by the user identifies a currency when the user hasselected a number or a number word and the context data includes acurrency name, sign, or code.

The system can determine whether the particular currency is differentfrom the currency associated with the user from the received contextdata. For example, if the context data includes an identifier for a useraccount associated with the user, the system can determine, from userprofile data for the user account, the country of residence of the userand can determine whether the particular currency is different from theofficial currency or currencies for the country of residence. As anotherexample, if the context data does not include an identifier for the useraccount associated with the user, the system can determine, fromlocation data for the user device, the country where the user device islocated and can determine whether the particular currency is differentfrom the official currency or currencies for that country. In someimplementations, the system determines that the currency associated withthe user is the official currency of the country where the user deviceis located even if data identifying the official currency of the countryof residence is available, e.g., to account for users travelling inforeign countries and selecting currency amounts in their home currencywanting to know the corresponding amount in the foreign currency.

If the particular currency is different from the currency associatedwith the user, the system determines that the criteria for presenting acurrency contextual search presentation are satisfied and generates acurrency contextual search presentation for the entity referred to bythe selected word. In order to generate the currency contextual searchpresentation, the system requests a currency answer box for the wordselected by the user from the search engine that presents an amount inthe particular currency and a corresponding amount in the currencyassociated with the user. For example, the system can request theconversion answer box by submitting a search query having apre-determined syntax to the search engine, e.g., “[amount] [particularcurrency] to [currency associated with the user]” or “how much is[amount] [particular currency] in [currency associated with the user],”where [amount] is either a default amount or an amount identified by theword selection or context data, [particular currency] is the particularcurrency, and [currency associated with the user] is the currencyassociated with the user.

The currency contextual search presentation may also include searchresults obtained from the search engine. The search results may includeone or more of search results obtained in response to the search queryderived from the selected word, search results from other resultsources, or search results other interpretations of the search query. Insome implementations, the search results include search results obtainedfor another search query that is different from the search querysubmitted to the search engine in order to obtain the currency answerbox. For example, the search results for the other search query mayinclude results about recent news about changes in the value of thecurrency or results about the history of the currency.

As another example, the special case contextual search presentations mayinclude a translation contextual search presentation. A translationcontextual search presentation is a contextual search presentation thatincludes a translation answer box. A translation answer box is an answerbox that presents a translation of a word from one language to another.

In order to determine whether the criteria for presenting thetranslation contextual search presentation are satisfied, the systemdetermines the language that the word selected by the user is written inand whether the language of the selected word is different from alanguage associated with the user, e.g., a language identified in userprofile data for the user as a language spoken by the user or anofficial language for the country of residence of the user.

If the language of the selected word is different from a languageassociated with the user, the system determines that the criteria forpresenting a translation contextual search presentation are satisfiedand generates a translation contextual search presentation for theentity referred to by the selected word. In order to generate thetranslation contextual search presentation, the system requests atranslation answer box for the word selected by the user from the searchengine that presents a translation of the selected word into thelanguage associated with the user. For example, the system can requestthe translation answer box by submitting a search query having apre-determined syntax to the search engine, e.g., “translate [word] into[language associated with the user]” or “translate [word] from [wordlanguage] to [language associated with the user],” where [word] is theselected word, [language associated with the user] is the languageassociated with the user, and [word language] is the language the wordis written in.

The translation contextual search presentation may also include searchresults obtained from the search engine. The search results may includeone or more of search results obtained in response to the search queryderived from the selected word, search results from other resultsources, or search results other interpretations of the search query. Insome implementations, the search results include search results obtainedfor another search query that is different from the search querysubmitted to the search engine in order to obtain the answer box. Forexample, the search results for the other search query may includeimages corresponding to the selected word.

As another example, the special case contextual search presentations mayinclude a time zone contextual search presentation. A time zonecontextual search presentation is a contextual search presentation thatincludes a time zone answer box. A time zone answer box is an answer boxthat presents a conversion of a time from one time zone to another.

In order to determine whether the criteria for presenting the time zonecontextual search presentation are satisfied, the system determineswhether the selected word identifies a time in a particular time zoneand, if so, whether the particular time zone is different from a timezone associated with the user, e.g., the time zone for the residence ofthe user identified in user profile data for the user or the time zoneof the current location of the user device. The system may determinethat the selected word identifies a time in a particular time zone ifthe selected word identifies a time zone and the context data includes atime, if the selected word identifies a time and the context dataidentifies a time zone, or both.

If the particular time zone is different from a time zone associatedwith the user, the system determines that the criteria for presenting atime zone contextual search presentation are satisfied and generates atime zone contextual search presentation for the entity referred to bythe selected word. In order to generate the time zone contextual searchpresentation, the system requests a time zone answer box for the wordselected by the user from the search engine that includes presents thetime from the particular time zone that corresponds to the time zoneassociated with the user. For example, the system can request the timezone answer box by submitting a search query having a pre-determinedsyntax to the search engine, e.g., “convert [time] [particular timezone] to [time zone associated with the user]” or “what time is [time][particular time zone] in [time zone associated with the user],” where[time] is the time, [particular time zone] is the particular time zone,and [time zone associated with the user] is the time zone associatedwith the user.

The time zone contextual search presentation may also include searchresults obtained from the search engine. The search results may includeone or more of search results obtained in response to the search queryderived from the selected word, search results from other resultsources, or search results other interpretations of the search query. Insome implementations, the search results include search results obtainedfor another search query that is different from the search querysubmitted to the search engine in order to obtain the currency answerbox. For example, the search results for the other search query mayinclude search results about maps of the time zone.

The above description describes certain special case contextual searchpresentations. However, other special case contextual searchpresentations may be presented when other criteria are satisfied. Forexample, other special case contextual presentations may include variouskinds of unit conversion answer boxes that present conversion ofmeasurements in one unit to measurements in other units.

The above description describes receiving word selection data thatidentifies a word selected by a user from a document displayed be theuser. However, in some implementations, the selection data can identifydifferent portions of the document that have been selected by the user,e.g., a term, i.e., one or more adjacent words, from the document. Inthese implementations, the system can receive and process the selectiondata in the same manner as described above for the word selection data.

In situations in which the systems described here collect personalinformation about users, or may make use of personal information, theusers may be provided with an opportunity to control whether programs orfeatures collect user information, e.g., user profile data and userdevice data, or to control whether and/or how to receive content thatmay be more relevant to the user. In addition, certain data may betreated in one or more ways before it is stored or used, so thatpersonally identifiable information is removed. For example, a user'sidentity may be treated so that no personally identifiable informationcan be determined for the user, or a user's geographic location may begeneralized where location information is obtained, such as to a city,postal code, or state level, so that a particular location of a usercannot be determined. Thus, the user may have control over howinformation is collected about the user and used by the system.

Embodiments of the subject matter and the functional operationsdescribed in this specification can be implemented in digital electroniccircuitry, in tangibly-embodied computer software or firmware, incomputer hardware, including the structures disclosed in thisspecification and their structural equivalents, or in combinations ofone or more of them. Embodiments of the subject matter described in thisspecification can be implemented as one or more computer programs, i.e.,one or more modules of computer program instructions encoded on atangible non-transitory program carrier for execution by, or to controlthe operation of, data processing apparatus. Alternatively or inaddition, the program instructions can be encoded on anartificially-generated propagated signal, e.g., a machine-generatedelectrical, optical, or electromagnetic signal, that is generated toencode information for transmission to suitable receiver apparatus forexecution by a data processing apparatus. The computer storage mediumcan be a machine-readable storage device, a machine-readable storagesubstrate, a random or serial access memory device, or a combination ofone or more of them.

The term “data processing apparatus” encompasses all kinds of apparatus,devices, and machines for processing data, including by way of example aprogrammable processor, a computer, or multiple processors or computers.The apparatus can include special purpose logic circuitry, e.g., an FPGA(field programmable gate array) or an ASIC (application-specificintegrated circuit). The apparatus can also include, in addition tohardware, code that creates an execution environment for the computerprogram in question, e.g., code that constitutes processor firmware, aprotocol stack, a database management system, an operating system, or acombination of one or more of them.

A computer program (which may also be referred to or described as aprogram, software, a software application, a module, a software module,a script, or code) can be written in any form of programming language,including compiled or interpreted languages, or declarative orprocedural languages, and it can be deployed in any form, including as astandalone program or as a module, component, subroutine, or other unitsuitable for use in a computing environment. A computer program may, butneed not, correspond to a file in a file system. A program can be storedin a portion of a file that holds other programs or data, e.g., one ormore scripts stored in a markup language document, in a single filededicated to the program in question, or in multiple coordinated files,e.g., files that store one or more modules, subprograms, or portions ofcode. A computer program can be deployed to be executed on one computeror on multiple computers that are located at one site or distributedacross multiple sites and interconnected by a communication network.

The processes and logic flows described in this specification can beperformed by one or more programmable computers executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application-specific integrated circuit).

Computers suitable for the execution of a computer program include, byway of example, can be based on general or special purposemicroprocessors or both, or any other kind of central processing unit.Generally, a central processing unit will receive instructions and datafrom a read-only memory or a random access memory or both. The essentialelements of a computer are a central processing unit for performing orexecuting instructions and one or more memory devices for storinginstructions and data. Generally, a computer will also include, or beoperatively coupled to receive data from or transfer data to, or both,one or more mass storage devices for storing data, e.g., magnetic,magneto-optical disks, or optical disks. However, a computer need nothave such devices. Moreover, a computer can be embedded in anotherdevice, e.g., a mobile telephone, a personal digital assistant (PDA), amobile audio or video player, a game console, a Global PositioningSystem (GPS) receiver, or a portable storage device, e.g., a universalserial bus (USB) flash drive, to name just a few.

Computer-readable media suitable for storing computer programinstructions and data include all forms of nonvolatile memory, media andmemory devices, including by way of example semiconductor memorydevices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks,e.g., internal hard disks or removable disks; magneto-optical disks; andCDROM and DVD-ROM disks. The processor and the memory can besupplemented by, or incorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube) or LCD (liquidcrystal display) monitor, for displaying information to the user and akeyboard and a pointing device, e.g., a mouse or a trackball, by whichthe user can provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well; for example,feedback provided to the user can be any form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any form, including acoustic, speech, ortactile input. In addition, a computer can interact with a user bysending documents to and receiving documents from a device that is usedby the user; for example, by sending web pages to a web browser on auser's user device in response to requests received from the webbrowser.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a backend component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a frontend component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described in this specification, or any combination of one ormore such backend, middleware, or frontend components. The components ofthe system can be interconnected by any form or medium of digital datacommunication, e.g., a communication network. Examples of communicationnetworks include a local area network (“LAN”) and a wide area network(“WAN”), e.g., the Internet.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of anyinvention or of what may be claimed, but rather as descriptions offeatures that may be specific to particular embodiments of particularinventions. Certain features that are described in this specification inthe context of separate embodiments can also be implemented incombination in a single embodiment. Conversely, various features thatare described in the context of a single embodiment can also beimplemented in multiple embodiments separately or in any suitablesubcombination. Moreover, although features may be described above asacting in certain combinations and even initially claimed as such, oneor more features from a claimed combination can in some cases be excisedfrom the combination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various system modulesand components in the embodiments described above should not beunderstood as requiring such separation in all embodiments, and itshould be understood that the described program components and systemscan generally be integrated together in a single software product orpackaged into multiple software products.

Particular embodiments of the subject matter have been described. Otherembodiments are within the scope of the following claims. For example,the actions recited in the claims can be performed in a different orderand still achieve desirable results. As one example, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In some cases, multitasking and parallel processing may beadvantageous.

What is claimed is:
 1. A method comprising: obtaining a first selectiondata identifying one or more words selected by a user from a documentdisplayed to the user in a user interface of a user device; obtainingcontext data comprising one or more words in the document other than theone or more words of the first selection data; providing the firstselection data and the context data to an entity disambiguation systemthat is configured to determine, based on the first selection data andthe context data, whether the selection data identifies an entity;receiving data indicating that the first selection data identifies anentity from the entity disambiguation system; in response to receivingdata from the entity disambiguation system indicating that the firstselection data identifies an entity: obtaining an entity-type specialcontextual search presentation that is formatted specifically to displaycontent relevant to an entity for the first selection data from among aplurality of contextual search presentations that includes (i) theentity-type special contextual search presentation and (ii) one or morecontextual search presentations that are formatted differently from theentity-type special contextual search presentation; and providing theentity-type special contextual search presentation for display in theuser interface of the user device.
 2. The method of claim 1, furthercomprising: obtaining a second selection data identifying one or morewords selected by the user from a document displayed to the user in theuser interface of the user device; obtaining context data comprising oneor more words in the document other than the one or more words of thesecond selection data; providing the second selection data and thecontext data to the entity disambiguation system that is configured todetermine, based on the second selection data and the context data,whether the second selection data identifies an entity; receiving dataindicating that the second selection data does not identify an entityfrom the entity disambiguation system; in response to receiving dataindicating that the second selection data does not identify an entity:determining that the second selection data and the context data satisfyone or more criteria for presenting a different type of specialcontextual search presentation for the second selection data that isformatted differently from the entity-type special contextual searchpresentation; in response to determining that the second selection dataand the context data satisfy one or more criteria for presenting thedifferent type of special contextual search presentation for the secondselection data: obtaining the different type of special contextualsearch presentation; and providing the different type of specialcontextual search presentation for display in the user interface of theuser device.
 3. The method of claim 1, further comprising: obtaining athird selection data identifying one or more words selected by the userfrom a document displayed to the user in the user interface of the userdevice; obtaining context data comprising one or more words in thedocument other than the one or more words of the third selection data;providing the third selection data and the context data to the entitydisambiguation system that is configured to determine, based on thethird selection data and the context data, whether the third selectiondata identifies an entity; receiving data indicating that the thirdselection data does not identify an entity from the entitydisambiguation system; in response to receiving data indicating that thethird selection data does not identify an entity: determining that thethird selection data and the context data do not satisfy one or morecriteria for presenting a different type of special contextual searchpresentation for the third selection data that is formatted differentlyfrom the entity-type special contextual search presentation; in responseto determining that the third selection data and the context data doesnot satisfy one or more criteria for presenting the different type ofspecial contextual search presentation for the selection data: obtaininga default contextual search presentation that is formatted differentlyfrom the entity-type special contextual search presentation; andproviding the default contextual search presentation for display in theuser interface of the user device.
 4. The method of claim 1, whereinobtaining an entity-type special contextual search presentation for theselection data includes obtaining a knowledge panel for the entityidentified by the first selection data.
 5. The method of claim 1,wherein providing the entity-type special contextual search presentationfor display in the user interface includes providing the entity-typespecial contextual search presentation for display in the user interfacewithout receiving any additional input from the user after the firstselection data is selected by the user.
 6. The method of claim 1,wherein providing the entity-type special contextual search presentationfor display in the user interface includes providing the entity-typespecial contextual search presentation for display in the user interfaceonly after receiving additional input from the user after the firstselection data is selected by the user.
 7. The method of claim 6,wherein the additional input from the user after the first selectiondata is selected by the user includes (i) selecting the entity-typespecial contextual search presentation, (ii) dragging the entity-typespecial contextual search presentation, (iii) or both.
 8. A system,comprising: one or more computers and one or more storage devicesstoring instructions that are operable, when executed by the one or morecomputers, to cause the one or more computers to perform operationscomprising: obtaining a first selection data identifying one or morewords selected by a user from a document displayed to the user in a userinterface of a user device; obtaining context data comprising one ormore words in the document other than the one or more words of the firstselection data; providing the first selection data and the context datato an entity disambiguation system that is configured to determine,based on the first selection data and the context data, whether theselection data identifies an entity; receiving data indicating that thefirst selection data identifies an entity from the entity disambiguationsystem; in response to receiving data from the entity disambiguationsystem indicating that the first selection data identifies an entity:obtaining an entity-type special contextual search presentation that isformatted specifically to display content relevant to an entity for thefirst selection data from among a plurality of contextual searchpresentations that includes (i) the entity-type special contextualsearch presentation and (ii) one or more contextual search presentationsthat are formatted differently from the entity-type special contextualsearch presentation; and providing the entity-type special contextualsearch presentation for display in the user interface of the userdevice.
 9. The system of claim 8, the operations further comprising:obtaining a second selection data identifying one or more words selectedby the user from a document displayed to the user in the user interfaceof the user device; obtaining context data comprising one or more wordsin the document other than the one or more words of the second selectiondata; providing the second selection data and the context data to theentity disambiguation system that is configured to determine, based onthe second selection data and the context data, whether the secondselection data identifies an entity; receiving data indicating that thesecond selection data does not identify an entity from the entitydisambiguation system; in response to receiving data indicating that thesecond selection data does not identify an entity: determining that thesecond selection data and the context data satisfy one or more criteriafor presenting a different type of special contextual searchpresentation for the second selection data that is formatted differentlyfrom the entity-type special contextual search presentation; in responseto determining that the second selection data and the context datasatisfy one or more criteria for presenting the different type ofspecial contextual search presentation for the selection data: obtainingthe different type of special contextual search presentation; andproviding the different type of special contextual search presentationfor display in the user interface of the user device.
 10. The system ofclaim 8, the operations further comprising: obtaining a third selectiondata identifying one or more words selected by the user from a documentdisplayed to the user in the user interface of the user device;obtaining context data comprising one or more words in the documentother than the one or more words of the third selection data; providingthe third selection data and the context data to the entitydisambiguation system that is configured to determine, based on thethird selection data and the context data, whether the third selectiondata identifies an entity; receiving data indicating that the thirdselection data does not identify an entity from the entitydisambiguation system; in response to receiving data indicating that thethird selection data does not identify an entity: determining that thethird selection data and the context data do not satisfy one or morecriteria for presenting a different type of special contextual searchpresentation for the third selection data that is formatted differentlyfrom the entity-type special contextual search presentation; in responseto determining that the third selection data and the context data doesnot satisfy one or more criteria for presenting the different type ofspecial contextual search presentation for the third selection data:obtaining a default contextual search presentation that is formatteddifferently from the entity-type special contextual search presentation;and providing the default contextual search presentation for display inthe user interface of the user device.
 11. The system of claim 8,wherein obtaining an entity-type special contextual search presentationfor the selection data includes obtaining a knowledge panel for theentity identified by the first selection data.
 12. The system of claim8, wherein providing the entity-type special contextual searchpresentation for display in the user interface includes providing theentity-type special contextual search presentation for display in theuser interface without receiving any additional input from the userafter the first selection data is selected by the user.
 13. The systemof claim 8, wherein providing the entity-type special contextual searchpresentation for display in the user interface includes providing theentity-type special contextual search presentation for display in theuser interface only after receiving additional input from the user afterthe first selection data is selected by the user.
 14. A non-transitorycomputer-readable medium storing software comprising instructionsexecutable by one or more computers which, upon such execution, causethe one or more computers to perform operations comprising: obtaining afirst selection data identifying one or more words selected by a userfrom a document displayed to the user in a user interface of a userdevice; obtaining context data comprising one or more words in thedocument other than the one or more words of the first selection data;providing the first selection data and the context data to an entitydisambiguation system that is configured to determine, based on thefirst selection data and the context data, whether the first selectiondata identifies an entity; receiving data indicating that the firstselection data identifies an entity from the entity disambiguationsystem; in response to receiving data from the entity disambiguationsystem indicating that the first selection data identifies an entity:obtaining an entity-type special contextual search presentation that isformatted specifically to display content relevant to an entity for thefirst selection data from among a plurality of contextual searchpresentations that includes (i) the entity-type special contextualsearch presentation and (ii) one or more contextual search presentationsthat are formatted differently from the entity-type special contextualsearch presentation; and providing the entity-type special contextualsearch presentation for display in the user interface of the userdevice.
 15. The computer-readable medium of claim 14, the operationsfurther comprising: obtaining a second selection data identifying one ormore words selected by the user from a document displayed to the user inthe user interface of the user device; obtaining context data comprisingone or more words in the document other than the one or more words ofthe second selection data; providing the second selection data and thecontext data to the entity disambiguation system that is configured todetermine, based on the second selection data and the context data,whether the second selection data identifies an entity; receiving dataindicating that the second selection data does not identify an entityfrom the entity disambiguation system; in response to receiving dataindicating that the second selection data does not identify an entity:determining that the second selection data and the context data satisfyone or more criteria for presenting a different type of specialcontextual search presentation for the second selection data that isformatted differently from the entity-type special contextual searchpresentation; in response to determining that the second selection dataand the context data satisfy one or more criteria for presenting thedifferent type of special contextual search presentation for the secondselection data: obtaining the different type of special contextualsearch presentation; and providing the different type of specialcontextual search presentation for display in the user interface of theuser device.
 16. The computer-readable medium of claim 14, theoperations further comprising: obtaining a third selection dataidentifying one or more words selected by the user from a documentdisplayed to the user in the user interface of the user device;obtaining context data comprising one or more words in the documentother than the one or more words of the third selection data; providingthe third selection data and the context data to the entitydisambiguation system that is configured to determine, based on thethird selection data and the context data, whether the third selectiondata identifies an entity; receiving data indicating that the thirdselection data does not identify an entity from the entitydisambiguation system; in response to receiving data indicating that thethird selection data does not identify an entity: determining that thethird selection data and the context data does not satisfy one or morecriteria for presenting a different type of special contextual searchpresentation for the third selection data that is formatted differentlyfrom the entity-type special contextual search presentation; in responseto determining that the third selection data and the context data doesnot satisfy one or more criteria for presenting the different type ofspecial contextual search presentation for the third selection data:obtaining a default contextual search presentation that is formatteddifferently from the entity-type special contextual search presentation;and providing the default contextual search presentation for display inthe user interface of the user device.
 17. The computer-readable mediumof claim 14, wherein obtaining an entity-type special contextual searchpresentation for the first selection data includes obtaining a knowledgepanel for the entity identified by the selection data.
 18. Thecomputer-readable medium of claim 14, wherein providing the entity-typespecial contextual search presentation for display in the user interfaceincludes providing the entity-type special contextual searchpresentation for display in the user interface without receiving anyadditional input from the user after the first selection data isselected by the user.
 19. The computer-readable medium of claim 14,wherein providing the entity-type special contextual search presentationfor display in the user interface includes providing the entity-typespecial contextual search presentation for display in the user interfaceonly after receiving additional input from the user after the firstselection data is selected by the user.
 20. The computer-readable mediumof claim 19, wherein the additional input from the user after the firstselection data is selected by the user includes (i) selecting theentity-type special contextual search presentation, (ii) dragging theentity-type special contextual search presentation, (iii) or both.